gtk4.git
9 years agoCall gsk_render_node_draw() instead of creating fallback renderers
Benjamin Otte [Tue, 13 Dec 2016 02:15:07 +0000 (03:15 +0100)]
Call gsk_render_node_draw() instead of creating fallback renderers

9 years agogsk: Add gsk_render_node_draw()
Benjamin Otte [Tue, 13 Dec 2016 02:05:15 +0000 (03:05 +0100)]
gsk: Add gsk_render_node_draw()

Draws a node to a given cairo_t. This is mostly intended for fallback
usage.

9 years agosnapshot: Change how gtk_snapshot_push/pop works
Benjamin Otte [Tue, 13 Dec 2016 01:33:15 +0000 (02:33 +0100)]
snapshot: Change how gtk_snapshot_push/pop works

Instead of appending a container node and adding the nodes to it as they
come in, we now collect the nodes until gtk_snapshot_pop() is called and
then hand them out in a container node.

The caller of gtk_snapshot_push() is then responsible for doing whatever
he wants with the created node.

Another addigion is the keep_coordinates flag to gtk_snapshot_push()
which allows callers to keep the current offset and clip region or
discard it. Discarding is useful when doing transforms, keeping it is
useful when inserting effect nodes (like the ones I'm about to add).

9 years agosnapshot: Handle clip region as part of the state
Benjamin Otte [Tue, 13 Dec 2016 00:44:52 +0000 (01:44 +0100)]
snapshot: Handle clip region as part of the state

This is in preparation for further changes.

9 years agogsk: gsk_render_node_set_transform() => GskTransformNode
Benjamin Otte [Mon, 12 Dec 2016 23:11:06 +0000 (00:11 +0100)]
gsk: gsk_render_node_set_transform() => GskTransformNode

Instead of having a setter for the transform, have a GskTransformNode.

Most of the oprations that GTK does do not require a transform, so it
doesn't make sense to have it as a primary attribute.

Also, changing the transform requires updating the uniforms of the GL
renderer, so we're happy if we can avoid that.

9 years agogsK: Move children handling to GskContainerNode
Benjamin Otte [Mon, 12 Dec 2016 18:30:41 +0000 (19:30 +0100)]
gsK: Move children handling to GskContainerNode

9 years agogsk: Remove GskRenderNode::parent
Benjamin Otte [Mon, 12 Dec 2016 17:54:49 +0000 (18:54 +0100)]
gsk: Remove GskRenderNode::parent

... and all related APIs.

9 years agoinspector: Prepare TreeModelRenderNode for brave new world
Benjamin Otte [Mon, 12 Dec 2016 17:53:41 +0000 (18:53 +0100)]
inspector: Prepare TreeModelRenderNode for brave new world

I'm about to move children handling to the container node, which means
the generic code can no longer assume children APIs existing.

So rewrite the treemodel to work without it.

9 years agogsk: Remove world matrix support
Benjamin Otte [Mon, 12 Dec 2016 15:52:55 +0000 (16:52 +0100)]
gsk: Remove world matrix support

Use the real transform and compute it manually.

9 years agogsk: Remove gsk_render_node_set_bounds()
Benjamin Otte [Mon, 12 Dec 2016 05:29:04 +0000 (06:29 +0100)]
gsk: Remove gsk_render_node_set_bounds()

gsk_render_node_get_bounds() still exists and is computed via vfunc
call:
- containers dynamically compute the bounds from their children
- surface and texture nodes get bounds passed on construction

9 years agogsk: Remove gsk_render_node_get_size()
Benjamin Otte [Sun, 11 Dec 2016 10:55:10 +0000 (11:55 +0100)]
gsk: Remove gsk_render_node_get_size()

In the brave new world of refactored render nodes, this function doesn't
really make any sense anymore. We could turn it into a vfunc, but I
don't think it's useful.

Especially because even in the brave old world, this function was
causing a vastl overallocation of nodes when the GL renderer needed render
targets.

9 years agogsk: Add GskRenderNodeClass.make_immutable()
Benjamin Otte [Sun, 11 Dec 2016 10:53:17 +0000 (11:53 +0100)]
gsk: Add GskRenderNodeClass.make_immutable()

9 years agogsk: Remove gsk_render_node_set_opaque()
Benjamin Otte [Sun, 11 Dec 2016 10:48:32 +0000 (11:48 +0100)]
gsk: Remove gsk_render_node_set_opaque()

If we ever feel, we need this function again, we can readd it later.

But nobody is using it other than for overriding opactiy. And you can
just override opacity directly if you care.

9 years agogsk: Add custom structs to RenderNode subclasses
Benjamin Otte [Sun, 11 Dec 2016 03:28:21 +0000 (04:28 +0100)]
gsk: Add custom structs to RenderNode subclasses

So now we don't need to keep a texture pointer and a surface pointer and
so on in the base struct.

9 years agogsk: Add GskRenderNodeClass.finalize()
Benjamin Otte [Sun, 11 Dec 2016 03:18:25 +0000 (04:18 +0100)]
gsk: Add GskRenderNodeClass.finalize()

9 years agogsk: Add gsk_container_node_new()
Benjamin Otte [Sun, 11 Dec 2016 03:14:04 +0000 (04:14 +0100)]
gsk: Add gsk_container_node_new()

It replaces gsk_renderer_create_render_node() which was doing the eact
same thing, only taking an unused extra argument.

9 years agogtk: Remove gtk_snapshot_append()
Benjamin Otte [Sun, 11 Dec 2016 03:13:22 +0000 (04:13 +0100)]
gtk: Remove gtk_snapshot_append()

It does not make sense to append an empty container node. Those should
only be push()'d.

9 years agogsk: Introduce GskRenderNodeClass
Benjamin Otte [Sun, 11 Dec 2016 02:57:42 +0000 (03:57 +0100)]
gsk: Introduce GskRenderNodeClass

This is modeled after GtkCssValueClass. So far it doesn't do anything.

9 years agogsk: Split render node subclasses out into their own file
Benjamin Otte [Sun, 11 Dec 2016 01:59:47 +0000 (02:59 +0100)]
gsk: Split render node subclasses out into their own file

9 years agogsk: Remove gsk_render_node_is_surface/texture()
Benjamin Otte [Sun, 11 Dec 2016 01:33:58 +0000 (02:33 +0100)]
gsk: Remove gsk_render_node_is_surface/texture()

Use gsk_render_node_get_node_type() instead.

9 years agogsk: Remove unneeded children modifiers
Benjamin Otte [Sun, 11 Dec 2016 00:51:35 +0000 (01:51 +0100)]
gsk: Remove unneeded children modifiers

Creating render nodes is fire-and-forget, so all one should do is create
a container, append, append, append and then send it off to the
renderer. So there's no need to replace, insert between or anything
else.

9 years agogsk: Add gsk_cairo_node_new()
Benjamin Otte [Sun, 11 Dec 2016 00:23:02 +0000 (01:23 +0100)]
gsk: Add gsk_cairo_node_new()

Split off Cairo drawn content nodes and require you to allocate them
using this new function.

9 years agogtk: Don't push cairo nodes
Benjamin Otte [Sat, 10 Dec 2016 23:12:02 +0000 (00:12 +0100)]
gtk: Don't push cairo nodes

We want to split nodes into containers and nodes that do actual drawing.
So pushing nodes that do drawing is exactly the wrong thing.

Also fix up GtkPopover. There's no need for it to push anything.

9 years agogsk: Add gsk_texture_node_new()
Benjamin Otte [Sat, 10 Dec 2016 21:52:22 +0000 (22:52 +0100)]
gsk: Add gsk_texture_node_new()

Start the transition into the different node types.

9 years agogsk: Add GskRenderNodeType
Benjamin Otte [Sat, 10 Dec 2016 20:42:01 +0000 (21:42 +0100)]
gsk: Add GskRenderNodeType

For now, this is unused.

9 years agogsk: Remove GskRenderNodeIter
Benjamin Otte [Sat, 10 Dec 2016 15:59:34 +0000 (16:59 +0100)]
gsk: Remove GskRenderNodeIter

9 years agogsk: Make GskRenderNode a boxed type
Benjamin Otte [Sat, 10 Dec 2016 14:33:16 +0000 (15:33 +0100)]
gsk: Make GskRenderNode a boxed type

9 years agogsk: Remove custom GValue API for GskRenderNode
Benjamin Otte [Sat, 10 Dec 2016 14:21:28 +0000 (15:21 +0100)]
gsk: Remove custom GValue API for GskRenderNode

9 years agogsk: Remove GskRenderNode::hidden
Benjamin Otte [Fri, 9 Dec 2016 23:18:03 +0000 (00:18 +0100)]
gsk: Remove GskRenderNode::hidden

If you want to hide something, don't render it.

9 years agogsk: Remove RenderNode::anchor-point
Benjamin Otte [Fri, 9 Dec 2016 23:01:29 +0000 (00:01 +0100)]
gsk: Remove RenderNode::anchor-point

9 years agoUpdate Hungarian translation
Balázs Meskó [Tue, 20 Dec 2016 15:14:01 +0000 (15:14 +0000)]
Update Hungarian translation

9 years agoUpdate Hungarian translation
Balázs Meskó [Tue, 20 Dec 2016 15:13:33 +0000 (15:13 +0000)]
Update Hungarian translation

9 years agoUpdate Spanish translation
Daniel Mustieles [Tue, 20 Dec 2016 11:32:30 +0000 (11:32 +0000)]
Update Spanish translation

9 years agoUpdate Spanish translation
Daniel Mustieles [Tue, 20 Dec 2016 11:31:59 +0000 (11:31 +0000)]
Update Spanish translation

9 years agobuild/Makefile.msvcproj: Fix cleanup
Chun-wei Fan [Tue, 20 Dec 2016 06:39:39 +0000 (14:39 +0800)]
build/Makefile.msvcproj: Fix cleanup

When we generate the Visual Studio 2013 projects, we need to remove the
*.vs12.sourcefiles and *.vs12.sourcefile.filters that are generated during
the process, so that 'make distcheck' won't complain about leftover files.

9 years agoflowbox: Export gtk_flow_box_get_child_at_pos as public API
Debarshi Ray [Fri, 16 Dec 2016 23:30:39 +0000 (00:30 +0100)]
flowbox: Export gtk_flow_box_get_child_at_pos as public API

https://bugzilla.gnome.org/show_bug.cgi?id=776187

9 years agoGtkStack: Remove redundant code
Debarshi Ray [Mon, 12 Dec 2016 20:04:05 +0000 (21:04 +0100)]
GtkStack: Remove redundant code

Commit 7ce96cb6ac28eeb62e003dcb9e0a8ce7d48e09e0 avoids notifications
during destruction by using gtk_widget_in_destruction. Therefore this
code is no longer needed.

This reverts commit 39e7afecb1ee882232e887e1b3e4c30ae0afe3a3

https://bugzilla.gnome.org/show_bug.cgi?id=749012

9 years agoGtkApplication: Lack of optional components shouldn't warn
Philip Chimento [Thu, 15 Dec 2016 22:09:49 +0000 (14:09 -0800)]
GtkApplication: Lack of optional components shouldn't warn

When running uninstalled tests with GtkApplication on an autobuilder with
a fake session bus, warnings will cause the tests to abort. The GNOME
session manager, the Xfce session manager, and the Inhibit portal are all
not needed for normal operation of GTK, so we should not log warnings if
they are not found.

As well as not being present on a fake session bus, it's also not
expected that they'll be present on all platforms.

https://bugzilla.gnome.org/show_bug.cgi?id=774784

9 years agoUse Unicode in translatable strings
Piotr Drąg [Mon, 3 Oct 2016 16:20:03 +0000 (18:20 +0200)]
Use Unicode in translatable strings

See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772371

9 years agoflowbox: Don't emit selected-children-changed during destruction
Debarshi Ray [Mon, 12 Dec 2016 20:12:51 +0000 (21:12 +0100)]
flowbox: Don't emit selected-children-changed during destruction

https://bugzilla.gnome.org/show_bug.cgi?id=776012

9 years agolistbox: Don't emit selected-rows-changed, etc. during destruction
Debarshi Ray [Sun, 18 Dec 2016 08:43:38 +0000 (09:43 +0100)]
listbox: Don't emit selected-rows-changed, etc. during destruction

https://bugzilla.gnome.org/show_bug.cgi?id=776012

9 years agoflowbox: Rename gtk_flow_box_find_child_at_pos for consistency
Debarshi Ray [Fri, 16 Dec 2016 22:40:21 +0000 (23:40 +0100)]
flowbox: Rename gtk_flow_box_find_child_at_pos for consistency

... with gtk_list_box_get_row_at_y. It would be nice to avoid the
'find' versus 'get' discrepancy since we are planning to expose it as
public API.

https://bugzilla.gnome.org/show_bug.cgi?id=776187

9 years agoGDK/Win32: Fix Windows backend after GdkWindow simplification
Chun-wei Fan [Mon, 19 Dec 2016 09:09:49 +0000 (17:09 +0800)]
GDK/Win32: Fix Windows backend after GdkWindow simplification

Fix the build after the branch wip/alexl/simplify-gdkwindow was merged, as
there are some changes that broke things in the Windows backend, namely:

-gdk_win32_input_shape_combine_region() should not be removed at this
 point (though it is a stub--otherwise GDK/Win32 will crash)

-Some more code need to be removed due to the removal of items in the
 above-mentioned merged branch

Also, like the X11 backend, do not allow the creation of native child
windows, and stop checking for subsequent child windows
(GDK_WINDOW_CHILD), so that we can clean things up a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=773299

9 years agoUpdated Czech translation
Marek Černocký [Mon, 19 Dec 2016 09:23:54 +0000 (10:23 +0100)]
Updated Czech translation

9 years agoscrolledwindow: Implement snapshot()
Benjamin Otte [Tue, 13 Dec 2016 14:14:49 +0000 (15:14 +0100)]
scrolledwindow: Implement snapshot()

9 years agoscrolledwindow: Fix rendering
Benjamin Otte [Tue, 13 Dec 2016 15:39:38 +0000 (16:39 +0100)]
scrolledwindow: Fix rendering

We used to allocate the gadget relative to the view window. We allocate
relative to widget->window now.

9 years agonotebook: Implement snapshot
Benjamin Otte [Wed, 14 Dec 2016 04:25:00 +0000 (05:25 +0100)]
notebook: Implement snapshot

9 years agoiconhelper: Implement snapshot
Benjamin Otte [Thu, 15 Dec 2016 04:58:22 +0000 (05:58 +0100)]
iconhelper: Implement snapshot

9 years agoprogressbar: Implement snapshot()
Benjamin Otte [Thu, 15 Dec 2016 05:22:06 +0000 (06:22 +0100)]
progressbar: Implement snapshot()

9 years agotoolbar: Implement snapshot()
Benjamin Otte [Thu, 15 Dec 2016 09:24:20 +0000 (10:24 +0100)]
toolbar: Implement snapshot()

9 years agoeventbox: Implement snapshot()
Benjamin Otte [Thu, 15 Dec 2016 09:45:21 +0000 (10:45 +0100)]
eventbox: Implement snapshot()

9 years agoseparatortoolitem: Implement snapshot()
Benjamin Otte [Thu, 15 Dec 2016 09:49:08 +0000 (10:49 +0100)]
separatortoolitem: Implement snapshot()

9 years agolevelbar: Implement snapshot()
Benjamin Otte [Sat, 17 Dec 2016 07:11:22 +0000 (08:11 +0100)]
levelbar: Implement snapshot()

9 years agoframe: Remove the border node
Benjamin Otte [Sun, 18 Dec 2016 19:06:33 +0000 (20:06 +0100)]
frame: Remove the border node

It does weird clipping that
(a) nobody likes
(b) is hard to support in the new rendering world.
So we take the easy way out.

The actual frame is now drawn by the frame node around the label.

9 years agocellview: Remove code to modify the background
Benjamin Otte [Mon, 19 Dec 2016 04:18:53 +0000 (05:18 +0100)]
cellview: Remove code to modify the background

GtkCellView has a gadget, so peopl can do all their shenanigans with
CSS.

And the original use case (overriding the background so that the
cellview's GdkWindow shares the background color of the combobox) is
outdated since we have transparent backgrounds.

9 years agoUpdated Czech translation
Marek Černocký [Sun, 18 Dec 2016 23:54:47 +0000 (00:54 +0100)]
Updated Czech translation

9 years agoMention that gdk_window_create_similar_image_surface inherits the scale
Debarshi Ray [Thu, 15 Dec 2016 12:17:57 +0000 (13:17 +0100)]
Mention that gdk_window_create_similar_image_surface inherits the scale

https://bugzilla.gnome.org/show_bug.cgi?id=776132

9 years agoMake gtk4-icon-browser work
Matthias Clasen [Wed, 14 Dec 2016 14:55:55 +0000 (09:55 -0500)]
Make gtk4-icon-browser work

It was using no-longer-existing widgets and properties.

9 years agogdk: Drop gdk_window_reparent
Alexander Larsson [Fri, 16 Dec 2016 11:35:03 +0000 (12:35 +0100)]
gdk: Drop gdk_window_reparent

We're not currently using this, and dropping it allows us to loose
a bunch of code which leads us towards the goal of having GdkWindow
only for toplevels (and reparenting makes not sense for toplevels).

9 years agogdk: Drop support for native (and thus foreign) subwindows
Alexander Larsson [Thu, 15 Dec 2016 16:53:08 +0000 (17:53 +0100)]
gdk: Drop support for native (and thus foreign) subwindows

We can't really support these on e.g. wayland anyway, and we're trying
to get rid of subwindow at totally in the long term, so lets drop this.
It allows us to drop a lot of complexity.

9 years agowayland: apply empty input shape on parent commit
Olivier Fourdan [Wed, 16 Nov 2016 14:05:43 +0000 (15:05 +0100)]
wayland: apply empty input shape on parent commit

For subsurfaces, the new state which includes the input shape is not
applied by the compositor if the subsurface is in effective synchronous
mode.

So we need to apply the input shape once parent surface is in effective
desynchronized mode, which is when it's committed, otherwise the input
shape may never be applied if the widget is not using being_paint() /
end_paint() to draw on its subsurface, like clutter does.

We do that only for empty input shape as those won't need update when
the subsurface is resized, for all other non-empty input shape, the
client still has to use begin_paint()/end_paint() for the input shape to
be applied.

https://bugzilla.gnome.org/show_bug.cgi?id=774534

9 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Wed, 14 Dec 2016 11:13:24 +0000 (11:13 +0000)]
Update Kazakh translation

9 years agoAdd a css parser test for border-spacing
Matthias Clasen [Sun, 11 Dec 2016 01:41:07 +0000 (20:41 -0500)]
Add a css parser test for border-spacing

9 years agoRemove -gtk-gradient from css parser tests
Matthias Clasen [Sun, 11 Dec 2016 01:40:48 +0000 (20:40 -0500)]
Remove -gtk-gradient from css parser tests

It is not supported anymore.

9 years agoDocument the border-spacing CSS property
Matthias Clasen [Sun, 11 Dec 2016 01:34:24 +0000 (20:34 -0500)]
Document the border-spacing CSS property

9 years agogrid: Implement support for CSS border-spacing
Benjamin Otte [Sat, 10 Dec 2016 03:32:19 +0000 (04:32 +0100)]
grid: Implement support for CSS border-spacing

9 years agoboxgadget: Implement CSS border-spacing
Benjamin Otte [Sat, 10 Dec 2016 03:19:04 +0000 (04:19 +0100)]
boxgadget: Implement CSS border-spacing

9 years agobox: Implement support for border-spacing
Benjamin Otte [Sat, 10 Dec 2016 02:47:53 +0000 (03:47 +0100)]
box: Implement support for border-spacing

9 years agobox: Remove unused member variable
Benjamin Otte [Sat, 10 Dec 2016 02:28:05 +0000 (03:28 +0100)]
box: Remove unused member variable

9 years agocss: Add "border-spacing" CSS property
Benjamin Otte [Sat, 10 Dec 2016 02:26:24 +0000 (03:26 +0100)]
css: Add "border-spacing" CSS property

It's using a GtkCssPositionValue, even though that name is wrong. But
the functionality of managing 2 lengths is exactly what we want.

Nobody is using this yet.

9 years agoUse the new defines
Matthias Clasen [Fri, 9 Dec 2016 20:51:25 +0000 (15:51 -0500)]
Use the new defines

It is no longer GDK_WINDOWING_VULKAN.

9 years agogtk: Remove unneeded gtk_snapshot_push()/pop() calls
Benjamin Otte [Fri, 9 Dec 2016 20:38:35 +0000 (21:38 +0100)]
gtk: Remove unneeded gtk_snapshot_push()/pop() calls

9 years agosnapshot: Always create an initial node
Benjamin Otte [Fri, 9 Dec 2016 20:33:38 +0000 (21:33 +0100)]
snapshot: Always create an initial node

This way we ensure that there is only one root node and everybody can
append() with impunity.

9 years agogsk: Improve GSK_RENDERER env var handling
Benjamin Otte [Fri, 9 Dec 2016 20:18:18 +0000 (21:18 +0100)]
gsk: Improve GSK_RENDERER env var handling

- Recognize "gl" as well as "opengl" for the GL renderer
- GSK_RENDERER=help now works
- g_warning() for an unrecognized renderer (typo detection!)
- g_print() the actual renderer that is used (and error messages when
  selecting) when a GSK_RENDERER is given, so you'll notice if your
  renderer isn't taken.

9 years agobuild: Don't try to detect vulkan library if the header wasn't found.
Benjamin Otte [Fri, 9 Dec 2016 20:17:27 +0000 (21:17 +0100)]
build: Don't try to detect vulkan library if the header wasn't found.

We've already failed. No need to fail again.

9 years agoTrivial doc fixups
Matthias Clasen [Fri, 9 Dec 2016 19:59:46 +0000 (14:59 -0500)]
Trivial doc fixups

9 years agobuild: Make sure GTK compiles without Vulkan headers installed
Benjamin Otte [Fri, 9 Dec 2016 19:21:18 +0000 (20:21 +0100)]
build: Make sure GTK compiles without Vulkan headers installed

Previously, code would work fine with --disable-vulkan if the Vulkan
headers were installed - code would happily just use them as they're
installed in /usr/include.

9 years agoForgotten file
Matthias Clasen [Fri, 9 Dec 2016 19:22:14 +0000 (14:22 -0500)]
Forgotten file

9 years agoRename GDK_WINDOWING_VULKAN
Matthias Clasen [Fri, 9 Dec 2016 19:11:37 +0000 (14:11 -0500)]
Rename GDK_WINDOWING_VULKAN

The WINDOWING defines are only for GDK backends, really.
Define GDK_RENDERING_VULKAN instead.

9 years agoOnly include vulkan.h if we have it
Matthias Clasen [Fri, 9 Dec 2016 19:05:26 +0000 (14:05 -0500)]
Only include vulkan.h if we have it

9 years agoFix the configure check for Vulkan
Matthias Clasen [Fri, 9 Dec 2016 19:00:48 +0000 (14:00 -0500)]
Fix the configure check for Vulkan

GDK_WINDOWING_VULKAN was getting defined regardless of the tests.

9 years agovulkan: Implement texture caching
Benjamin Otte [Fri, 9 Dec 2016 06:23:04 +0000 (07:23 +0100)]
vulkan: Implement texture caching

And with this change, the GPU looks bored again.

9 years agovulkan: Don't create more than one render object
Benjamin Otte [Fri, 9 Dec 2016 05:13:14 +0000 (06:13 +0100)]
vulkan: Don't create more than one render object

By creating unlimited render objects, we would never wait on the GPU.

This would mean that if the GPU was the bottleneck, we would fill its
queue with render commands faster than it could process them.

And because the nvidia binary driver and my code work surprisingly well
and bugfree, this lead to exhaustion of RAM. I had 50GB of swap
configured and my hard disk was quicker as swap storage than my GPU was
at processing the commands, so stuff still filled up.

At that point my computer became rather unresponsive and I decided to
reboot it, so I that could write this patch.

9 years agovulkan: Don't limit number of descriptor sets
Benjamin Otte [Fri, 9 Dec 2016 05:09:52 +0000 (06:09 +0100)]
vulkan: Don't limit number of descriptor sets

If we need more than we have reserved as maximum, recreate the
descriptor pool with a higher maximum.

9 years agovulkan: Add more node operations
Benjamin Otte [Fri, 9 Dec 2016 04:59:19 +0000 (05:59 +0100)]
vulkan: Add more node operations

Add SURFACE and TEXTURE operations. This way, we actually render more
than one node every frame because not everything is a fallback node
anymore that gets composited with its children into a cairo surface.

9 years agovulkan: Push the correct matrix when drawing
Benjamin Otte [Fri, 9 Dec 2016 04:53:04 +0000 (05:53 +0100)]
vulkan: Push the correct matrix when drawing

Instead of pushing the root matrix, push the world matrix for the
current node. That way, the bounds we emit as vertices are actually
properly transformed.

9 years agovulkan: Enable alpha blending
Benjamin Otte [Fri, 9 Dec 2016 04:51:51 +0000 (05:51 +0100)]
vulkan: Enable alpha blending

We will need that once we actually composite stuff.

9 years agovulkan: Redo descriptor set handling
Benjamin Otte [Fri, 9 Dec 2016 01:55:47 +0000 (02:55 +0100)]
vulkan: Redo descriptor set handling

First, we collect all the info about descriptor sets into a hash table,
then we use its size to determine the amount of sets and allocate those
before we finally go ahead and use the hash table's contents to
initialize the descriptor sets.

And then we're ready to render.

9 years agovulkan: Move remaining structs to VulkanRender object
Benjamin Otte [Thu, 8 Dec 2016 23:06:59 +0000 (00:06 +0100)]
vulkan: Move remaining structs to VulkanRender object

It now gets to maintain things.

9 years agovulkan: Create framebuffers from GskVulkanRender object
Benjamin Otte [Thu, 8 Dec 2016 21:35:16 +0000 (22:35 +0100)]
vulkan: Create framebuffers from GskVulkanRender object

Also create them on-demand, as they need to be created per-image and
per-framebuffer, so we don't want to create loads of them.

9 years agovulkan: Turn swapchain image targets into GskVulkanImages
Benjamin Otte [Thu, 8 Dec 2016 20:14:41 +0000 (21:14 +0100)]
vulkan: Turn swapchain image targets into GskVulkanImages

This gives us proper refcounting here, too. And there's no longer a
difference between the different types of images.

9 years agovulkan: Store width/height of GskVulkanImage
Benjamin Otte [Thu, 8 Dec 2016 19:46:02 +0000 (20:46 +0100)]
vulkan: Store width/height of GskVulkanImage

This is to enable lazy framebuffer creation later.

9 years agovulkan: Turn GskVulkanImage into a GObject
Benjamin Otte [Thu, 8 Dec 2016 19:19:56 +0000 (20:19 +0100)]
vulkan: Turn GskVulkanImage into a GObject

This way, we can do real refcounting on them.

9 years agovulkan: Hook up image upload mechanism to env variables
Benjamin Otte [Thu, 8 Dec 2016 19:05:53 +0000 (20:05 +0100)]
vulkan: Hook up image upload mechanism to env variables

Instead of having to decie at compile-time, check if
GSK_RENDERING=staging-image was given, and if so, select the staging
image upload mode.

9 years agovulkan: Don't wait until graphics are done computing
Benjamin Otte [Thu, 8 Dec 2016 18:56:56 +0000 (19:56 +0100)]
vulkan: Don't wait until graphics are done computing

We can let the GPU do its stuff without waiting. The GPU knows what it's
doing.

Which means we now get a lot of time to spend on doing CPU things (read:
we're way better in benchmarks).

The old behavior is safer, so we want to keep it around for debugging.
It can be reenabled with GSK_RENDERING_MODE=sync.

9 years agovulkan: Keep render objects around
Benjamin Otte [Thu, 8 Dec 2016 17:40:35 +0000 (18:40 +0100)]
vulkan: Keep render objects around

That way we can reuse them. We only create a new one if the last render
operation hasn't finished executing.

9 years agovulkan: Move command pool and fence into render object
Benjamin Otte [Thu, 8 Dec 2016 17:03:05 +0000 (18:03 +0100)]
vulkan: Move command pool and fence into render object

9 years agovulkan: Make the GskVulkanRender struct private
Benjamin Otte [Thu, 8 Dec 2016 16:55:32 +0000 (17:55 +0100)]
vulkan: Make the GskVulkanRender struct private

9 years agovulkan: Make the VulkanRender object allocated
Benjamin Otte [Thu, 8 Dec 2016 16:46:08 +0000 (17:46 +0100)]
vulkan: Make the VulkanRender object allocated

That way, we can have multiple of those and keep them around for reuse.

9 years agovulkan: Also wait on the draw semaphore when present()ing
Benjamin Otte [Thu, 8 Dec 2016 16:40:07 +0000 (17:40 +0100)]
vulkan: Also wait on the draw semaphore when present()ing

That way we have a synchronization primitive at the start and at the
end.